package com.lezhi.socialgram.service.sys.impl;

import java.sql.SQLException;
import java.util.Date;
import java.util.List;

import com.lezhi.socialgram.mapper.sys.OrderDAO;
import com.lezhi.socialgram.model.sys.OrderInfo;
import com.lezhi.socialgram.service.sys.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


@Service
public class OrderServiceImp implements OrderService {
	
	@Autowired
	private OrderDAO orderDAO = null;

	public void updateOrderByChargeId(OrderInfo orderInfo) throws SQLException {
		
		orderDAO.updateOrderByChargeId(orderInfo);
	}

	public void addOrder(OrderInfo orderInfo) throws SQLException{
		
		orderDAO.addOrder(orderInfo);
	}
	
	public OrderInfo selectOrderByChargeId(OrderInfo orderInfo) throws SQLException
	{
		return orderDAO.selectOrderByChargeId(orderInfo);
	}
	
	public List<OrderInfo> getOrderListByTelNum(String telNum) throws SQLException{
		return orderDAO.getOrderListByTelNum(telNum);
	}
	
	public List<OrderInfo> getSuccessOrderListByTelNum(String telNum) throws SQLException{
		
		return orderDAO.getSuccessOrderListByTelNum(telNum);
	}

	public void setOrderDAO(OrderDAO orderDAO) {
		this.orderDAO = orderDAO;
	}

	public List<OrderInfo> getSuccessOrderListWithLimit(Date startDate) throws SQLException
	{
		return orderDAO.getSuccessOrderListWithLimit(startDate);
	}

}
